import { INCREMENT, CHANGEDATALIST } from './constants'
const defaultState = {
  counter: 0,
  dataList: [],
}
export default function (state = defaultState, action) {
  switch (action.type) {
    case INCREMENT:
      return { ...state, counter: state.counter + 1 }
      break
    case CHANGEDATALIST:
      return { ...state, dataList: action.dataList }
    default:
      return state
  }
}
